package com.oro.backingbeans;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.apache.log4j.Logger;

//@ManagedBean(name = "helloBean")
//@SessionScoped
public class HelloBean {

	Logger logger;

	private String name;

	private Logger getLogger() {
		if (logger == null) {
			logger = Logger.getLogger(HelloBean.class);
		}
		return logger;
	}

	public String getName() {
		return name;
	}

	@PostConstruct
	public void postConstruct() {
		getLogger().info("HelloBean has been constructed.");
	}

	@PreDestroy
	public void preDestroy() {
		getLogger().info("HelloBean is being destroyed.");
	}

	public String sayHello() {
		return "hello";
	}

	public void setName(String name) {
		this.name = name;
	}

}
